<?php 
/* 
Template Name: Gallery TTNaNo NL
*/
?>
<?php get_header(); ?>

<div id="content_nano">
      <!--banner section -->
      <div id="banner_wrapp">
        <div id="banner">
          <?php if ( get_option('chameleon_featured') == 'on' ) get_template_part('includes/featured'); ?>
        </div><!-- id="banner" -->
                  <?php 
                  /*
                  //  catalogue dong ben trai 

                        <div id="banner_accordion">
                          <div class="acord_box">
                            <div class="hdaccor">
                              <h2>Find out Right Program for you</h2>
                            </div>
                            <div class="slideaccor">
                              <h5>Browse by Category</h5>
                              <ul>
                                <li><a href="#" class="active">Browse undergraduate</a></li>
                                <li><a href="#">Browse postgraduate</a></li>
                            <li><a href="#">Browse Courses</a></li>
                            <li><a href="#">Others</a></li>
                          </ul>
                          <h6>You Already applied?</h6>
                          <a href="#" class="btn_banner1">Order Printed Prospectus</a> <a href="#" class="btn_banner2">Check Application Process</a> </div>
                      </div><!-- class="acord_box" -->
            		  
                      <div class="acord_box">
                        <div class="hdaccor">
                          <h2>International Students</h2>
                        </div>
                        <div class="slideaccor">
                          <div class="student_box"> <img src="<?php bloginfo('template_directory'); ?>/images/img-student.jpg" alt="" />
                            <h2>Jai Parkash ( INDIA)</h2>
                            <p>Lorem ipsum dolor sit amet, ctetur adiiscing elit. Quisque sit amet sem felisLorem ipsum dolor sit amet, ctetur adiiscing elit. Quisque sit amet sem felis    Read More</p>
                          </div>
                        </div>
                      </div><!-- class="acord_box" -->
            		  
                      <div class="acord_box">
                        <div class="hdaccor">
                          <h2>Quick Links</h2>
                        </div>
                        <div class="slideaccor">
                          <ul>
                            <li><a href="#" class="active">Collge Exams List</a></li>
                            <li><a href="#">Illumni</a></li>
                            <li><a href="#">Sports Festivels</a></li>
                            <li><a href="#">National Day</a></li>
                            <li><a href="#">Books and Classis</a></li>
                            <li><a href="#">Our New courses</a></li>
                            <li><a href="#">Famous Courses</a></li>
                            <li><a href="#">A to Z Pages</a></li>
                            <li><a href="#">Top Courses</a></li>
                            <li><a href="#">Staff Section</a></li>
                          </ul>
                          <a href="#" class="btn_banner1">Go to Quick Link Page</a> 
            			</div><!-- class="slideaccor" -->
            			
                      </div><!-- class="acord_box" -->
            		  
                    </div><!-- id="banner_accordion" -->
                */
                ?>
		
      </div><!-- id="banner_wrapp" -->



		<?php get_template_part('includes/breadcrumbs'); ?>
		<?php //get_template_part('includes/top_info'); ?>

    <div id="gallery">

        <div class="heading_gallery">
          <h1>Thư viện ảnh Trung tâm Nano và Năng lượng </h1>
          <?php //edit_post_link(esc_html__('Chỉnh sửa','Chameleon','')); ?>
              <!--
              <ul>
                <li><a href="#">Image</a></li>
                <li><a href="#">Videos</a></li>
              </ul>
            -->
        </div><!-- class="heading_gallery" -->
        <!--
        <div class="gallery_category">
          <h2>College Basket Ball Match</h2>
          <div class="select_gallery">
            <label>Album</label>
            <select>
              <option>Basket Ball Match</option>
            </select>
          </div>
        </div><!-- class="gallery_category"> -->



        <div id="content_gallery">
          <ul>
      			<?php 

           global $post;
            $args = array('numberposts'=>3, 'category'=>46, 'orderby'=>'rand');
            $custom_posts = get_posts($args);
          
            foreach($custom_posts as $post) : setup_postdata($post);
             $Id_post_custom = get_post_custom($post->ID);

             //var_dump($Id_post_custom['video_link'][0]);
             /*
              $lop = (array)$post;
             // var_dump($lop['ID']);
              $dg = $lop['ID'];
             // echo $dg;
              //print_r($lop);
              */
              
            ?>
           <?php if ( $Id_post_custom['video_link'][0] =='' ) 
               {  // truong hop la anh binh thuong 
                ?>
      		
                  <li>
                    <?php  if ( has_post_thumbnail()) {
                         $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large'); 
                    ?>
                    <a href="<?php echo $large_image_url[0];?>" rel="galleryimages"> 
                    <?php echo the_post_thumbnail( array(300,300) );?>
                     <span><?php the_title();?></span> 
                   </a>

                   <?php }?>
                  
                  <?php edit_post_link(esc_html__('Sửa','Chameleon')); ?> 
                 </li> 
                 
        <?php } elseif ( $Id_post_custom['video_link'][0] <> '' ) { 
                 // truong hop la video 
             ?>

                   <li>
                    <a href="<?php echo $Id_post_custom['video_link'][0]; ?>" class="galleryvideo"> 
                    <?php echo the_post_thumbnail( array(300,300) );?> 
                    <span><?php the_title();?></span> 
                    </a>
                  </li>

            <?php 
              } //end elseif ( $Id_post_custom['video_link'][0] <> '' )
             
            endforeach;
            wp_reset_postdata();
             ?>
      			
			 </ul>
          <br class="clear" />

 </div>
</div> <!-- id="gallery" -->


 <?php wp_link_pages(array('before' => '<p><strong>'.esc_html__('Trang','Chameleon').':</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
                  <?php if (get_option('chameleon_show_pagescomments') == 'on') comments_template('', true); ?>

             
</div><!-- id="content_nano" -->

<div class="pagination clearfix">
  <div class="alignleft"><?php next_posts_link(esc_html__('&laquo; Về Trước','Chameleon')) ?></div>
  <div class="alignright"><?php previous_posts_link(esc_html__('Đi Tiếp &raquo;', 'Chameleon')) ?></div>
</div>




		
<?php get_footer(); ?>


<?php 
/*
// truy van nhieu catagory  de lam thu vien anh 


$blog_cats = isset( $et_ptemplate_settings['et_ptemplate_blogcats'] ) ? (array) $et_ptemplate_settings['et_ptemplate_blogcats'] : array();
 $cat_query = ''; 
        //var_dump($blog_cats);
        if ( !empty($blog_cats) ) $cat_query = '&cat=' . implode(",", $blog_cats);
        else echo '<!-- blog category is not selected -->'; 

         // var_dump($cat_query);

        ?>
        <?php 
          $et_paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' );
        ?>
        <?php query_posts("showposts=$et_ptemplate_blog_perpage&paged=" . $et_paged . $cat_query); ?>
        <?php if (have_posts()) : while (have_posts()) : the_post(); 
            ## code..................

        ?>
          <?php endwhile; ?>
*/
?>